home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18507 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  35 lines

  1. Path: lf.hp.com!gajdos
  2. From: gajdos@lf.hp.com (Larry Gajdos)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP!! Using STL with Visual C++ 4.1
  5. Date: 20 Apr 1996 16:14:14 GMT
  6. Organization: Hewlett-Packard Little Falls Site
  7. Message-ID: <4lb2gm$h9l@hpavua.lf.hp.com>
  8. References: <31780118.6204@macromedia.com>
  9. NNTP-Posting-Host: gajdos@eden.lf.hp.com
  10.  
  11. : I'm trying to use the STL in my applications using the Visual
  12. : C++ compiler.  I've taken the steps suggested by Microsoft
  13. : reguarding the use of namespaces and min/max definitions.  But
  14. : the compiler still chokes on line 124 of defalloc.h:
  15.  
  16. : 122   template <class T1, class T2>
  17. : 123   inline void construct(T1* p, const T2& value) {
  18. : 124       new (p) T1(value);
  19. : 125   }
  20.  
  21. : The error is:
  22.  
  23. : error C2661: 'new' : no overloaded function takes 2 parameters
  24.  
  25. You can solve this problem by using
  26.  
  27. #include <new.h>
  28.  
  29. _before_ declaring the STL templates with the STD namespace.
  30.  
  31. See my earlier post and Robert Kleeman's response for further
  32. details.
  33.  
  34. Larry Gajdos, not speaking for HP
  35.